<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../res/vue.js"></script>
    <link rel="stylesheet" href="app.css"></link>
</head>
<body>
<script type="text/javascript">
</script>
<div id="app-1">
    <div class="parent">
        <child>
            <template scope="props">
                <span>hello from parent</span><br/>
                <span>{{props.text}}</span><br/>
                <span>{{props.names}}</span><br/>
                <hr/>
            </template>
        </child>
    </div>

    <my-awesome-list >
        <template slot="item" scope="props">
            <li class="my-fancy-item">{{props.text}}</li>
        </template>
    </my-awesome-list>
</div>
</body>
<script type="text/javascript">
    Vue.component('child',{
        template:'<div class="child">' +
        '<slot names="测试" text="你好"></slot>' +
        '<slot text="hello from child"></slot>' +
        '<slot text="hello from child"></slot>' +
        '</div>'
    });

    Vue.component('my-awesome-list',{
        template:'<ul><slot name="item" v-for="item in items" :text="item.text"></slot></ul>',
        data:function(){
            return {
                items:[{
                    text:'hello'
                },{
                    text:'world'
                }]
            }
        }
    });

    var app = new Vue({
        el:'#app-1',
        data:{

        },
    });
</script>
</html>